import { SQLiteManager } from './dbHelp.js'
import { Logger } from './log.js';
import { CommandExecutor } from './commandExecutor.js'

const os = require('os');
const path = require('path');

// 获取根目录
const homepath = os.homedir()
const logFilePath = path.join(homepath, 'wumaapp', 'app.log');
const dbFilePath = path.join(homepath, 'wumaapp', 'wuma.db');

//初始化日志
let logger = new Logger();
logger.setLogPath(logFilePath);


logger.info('文件路径,log:' + logFilePath  +' db:'+ dbFilePath);

//初始化DB
const dbManager = new SQLiteManager(dbFilePath, logger);
dbManager.initCmdTable()

//初始化命令执行器
const cmdExecutor = new CommandExecutor(logger, dbManager);


export  { logger, dbManager, cmdExecutor };




